package cn.wolfcode.Controller;


import cn.wolfcode.domain.Consumption;
import cn.wolfcode.domain.ConsumptionItem;
import cn.wolfcode.qo.QueryObject;
import cn.wolfcode.qo.jsonResult;
import cn.wolfcode.service.IAppointmentService;
import cn.wolfcode.service.IConsumptionItemService;
import cn.wolfcode.util.RequirePermission;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/consumptionItem")
public class ConsumptionItemController {

    @Autowired
    private IConsumptionItemService consumptionService;



    @RequestMapping("/delete")
@RequirePermission(name = "结算单页面",experssion = "consumption:list")
    @ResponseBody
    public jsonResult delete(Long id){
        if (id != null) {
            consumptionService.delete(id);
        }
        return new jsonResult();
    }


    @RequestMapping("/insert")
@RequirePermission(name = "结算明细添加单页面",experssion = "consumption:insert")
    @ResponseBody
    public jsonResult inert(ConsumptionItem consumptionItem){
        consumptionService.insert(consumptionItem);
        return  new jsonResult(true,"操作成功");
    }






}
